package com.ying.rabbitmqspringbootproducer.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: LimitConfig
 * Package: com.ying.rabbitmqspringbootproducer.config
 * Description:
 *
 * @Author 刘英杰
 * @Create 2025/7/25 22:36
 * @Version 1.0
 */

@Configuration
public class LimitConfig {

    public static final String QUEUE_LIMIT_NAME = "limitQueue";

    @Bean
    public Queue limitQueue() {
        return QueueBuilder.durable(QUEUE_LIMIT_NAME).build();
    }

    @Bean
    public Binding bindingLimitQueue(Exchange confirmExchange, Queue limitQueue) {
        return BindingBuilder.bind(limitQueue).to(confirmExchange).with("warning").noargs();
    }

}
